import JSEncrypt from 'jsencrypt/bin/jsencrypt'
import { ZZ_PUBLIC_KEY } from '@/constants';
import { ElScrollbar } from 'element-plus';

export function encryptPassword(password) {
  if(password==undefined){
    return null
  }else{
  // 密码为空，默认密码123456
  const pass = password || '123456';
  const encrypt = new JSEncrypt();
  encrypt.setPublicKey(ZZ_PUBLIC_KEY);
  const encryptPassword = encrypt.encrypt(pass);
  console.log(encryptPassword,'encryptPassword加密');
  return encryptPassword;
  }
}
